﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAcess;
using Model;
using System.Data.Entity;

namespace BreakAwayConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            InsertDestination();
            Console.WriteLine("OK");
        }

        private static void InsertDestination()
        {

            var destination = new Destination

            {

                Country = "Indonesia",

                Description = "EcoTourism at its best in exquisite Bali",

                Name = "Bali"

            };

            using (var context = new BreakAwayContext())
            {
                try
                {
                    context.Destinations.Add(destination);
                    context.SaveChanges();
                }
                catch (Exception ee)
                {
                    
                    throw ee;
                }

                

            }

        }
    }
}
